package com.sz.common.core.service;

import com.sz.common.core.MockApplication;
import com.sz.common.base.constants.UnitSetting;
import com.sz.common.base.logger.Logger;

import org.junit.After;
import org.junit.Before;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.annotation.Rollback;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.transaction.annotation.Transactional;

/**
 * Function: ServiceTestBase <br>
 * Author: Charles <br>
 * Date: 2017-01-20 17:18:00
 */
@RunWith(SpringJUnit4ClassRunner.class)
@SpringBootTest(classes = MockApplication.class)
@Transactional
@Rollback
public class ServiceTestBase {
    public Logger logger = Logger.getLogger(this.getClass());

    public ServiceTestBase(){

    }

    @Before
    public void setUp() {
        logger.debug("setUp service for unit test");
        System.setProperty(UnitSetting.getUnitTestFlag(),"true");
    }

    @After
    public void tearDown() {
        logger.debug("tearDown service for unit test");
    }
}
